/* 
 * File:   Sensor_Info.h
 * Author: lusitanio
 *
 * Created on 16 de Fevereiro de 2012, 0:33
 */

#ifndef SENSOR_INFO_H
#define	SENSOR_INFO_H

#include <string>
#include <iostream>
#include <math.h>

using namespace std;

class Sensor_Info {
    //Variaveis
private:
    int id;
    float xx;
    float yy;

public:

    Sensor_Info() {
        this->id = NULL;
        this->xx = NULL;
        this->yy = NULL;

    }

    Sensor_Info(int i, float x, float y) {
        this->id = i;
        this->xx = x;
        this->yy = y;

    }

    virtual ~Sensor_Info() {
        this->id = NULL;
        this->xx = NULL;
        this->yy = NULL;

    }

    int GetId() const {
        return id;
    }

    void SetId(int id) {
        this->id = id;
    }

    float GetXx() const {
        return xx;
    }

    void SetXx(float xx) {
        this->xx = xx;
    }

    float GetYy() const {
        return yy;
    }

    void SetYy(float yy) {
        this->yy = yy;
    }

    float checkInRange(Sensor_Info d, float range) {
        float distance = sqrt(pow((d.GetXx() - this->xx),2) + pow((d.GetYy() - this->yy),2));
        float w_return = -1.0;
        if (distance < range)
            w_return = distance;
        return w_return;
    }

    void print() {
        printf("**  Sensor[%d][x][y]:[%2.2f][%2.2f]  **\n", this->id, this->xx, this->yy);
    }


};



#endif	/* SENSOR_INFO_H */

